package com.ymatou.iapi.userservice.testcase;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.userservice.parameter.QueryRsaPubKeyBean;
import com.ymatou.iapi.userservice.service.QueryRsaPubKeyCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
/**
*获取公钥
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_QueryRsaPubKey{
	private static QueryRsaPubKeyBean queryrsapubkeyBean;
	private static QueryRsaPubKeyCall queryrsapubkeyCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取公钥");
	}

	@Before
	public void caseUp() {
		queryrsapubkeyBean=new QueryRsaPubKeyBean();
		queryrsapubkeyCall=new QueryRsaPubKeyCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(queryrsapubkeyCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_QueryRsaPubKey_001() {
		Logger.start(true,"获取公钥,成功");
		try {
			queryrsapubkeyBean.setAppId("autotest");
			queryrsapubkeyCall.setData(queryrsapubkeyBean);
			queryrsapubkeyCall.callService();			
			Logger.verifyEquals("true", queryrsapubkeyCall.getString("Success"), "验证Success");
			Logger.verifyEquals("200", queryrsapubkeyCall.getString("ResponseCode"), "验证ResponseCode");
			String key=queryrsapubkeyCall.getJsonObject().get("Result").getAsString();
			Logger.verifyNotNull(key,"验证key");
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}